package com.hitqz.robot.api.business.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hitqz.robot.api.dispatch.protocol.dto.FormConfigModalDto;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;
import java.util.Objects;

/**
 * @author xupkun
 * @date 2024/8/6
 */
public class RobotJobVo {

    @Schema(description = "id")
    private Integer id;

    /**
     * 名称
     */
    @Schema(description="名称")
    private String name;

    /**
     * 开始时间
     */
    @Schema(description="开始日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date startTime;

    /**
     * 结束时间
     */
    @Schema(description="结束日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date endTime;

    /**
     * 当天时间范围
     */
    @Schema(description="当天允许开始时间")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date dayStartTime;

    /**
     * 当天时间范围
     */
    @Schema(description="当天允许结束时间")
    @JsonFormat(pattern = "HH:mm:ss", timezone = "GMT+8")
    private Date dayEndTime;

    @Schema(description = "时间表达式")
    private String cron;

    /**
     * 0-不启用 1-启用
     */
    @Schema(description="0-不启用 1-启用")
    private String enable;

    @Schema(description="中文描述")
    private String enableStr;

    @Schema(description = "任务内容")
    private String content;

    @Schema(description="调度组id")
    private Integer groupId;

    @Schema(description= "调度组名称")
    private String groupName;


    @Schema(description = "动态表单任务内容")
    private FormConfigModalDto modalData;



    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }

    public Date getDayStartTime() {
        return dayStartTime;
    }

    public void setDayStartTime(Date dayStartTime) {
        this.dayStartTime = dayStartTime;
    }

    public Date getDayEndTime() {
        return dayEndTime;
    }

    public void setDayEndTime(Date dayEndTime) {
        this.dayEndTime = dayEndTime;
    }

    public String getCron() {
        return cron;
    }

    public void setCron(String cron) {
        this.cron = cron;
    }

    public String getEnable() {
        return enable;
    }

    public void setEnable(String enable) {
        this.enable = enable;
    }

    public String getEnableStr() {
        return Objects.equals(enable, "1") ? "启用": "禁用";
    }

    public void setEnableStr(String enableStr) {
        this.enableStr = enableStr;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getGroupId() {
        return groupId;
    }

    public void setGroupId(Integer groupId) {
        this.groupId = groupId;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }


    public FormConfigModalDto getModalData() {
        return modalData;
    }

    public void setModalData(FormConfigModalDto modalData) {
        this.modalData = modalData;
    }
}
